import java.util.Scanner;

public class demo03 {
    public static void main(String[] args) {
        int len1=1189;
        int len2=841;
        Scanner sc = new Scanner(System.in);
        String str=sc.nextLine();
        int n=str.charAt(1)-'0';
        for (int i = 0; i < n; i++) {
            if(len1>len2){
                len1/=2;
                continue;
            }
            if(len1<len2) {
                len2/=2;
            }
        }
        System.out.println(Math.max(len1,len2));
        System.out.println(Math.min(len1,len2));
        sc.close();
    }
}
